#include "etoolbar.h"

EToolBar::EToolBar(int x,int y,int w,int h) : Fl_Group(x,y,w,h)
{
    box(FL_PLASTIC_DOWN_BOX);
    size(w,h);
    position(x,y);
    Fl::scheme("gtk+");
    node=new Fl_Round_Button(x,y+25,w-10,20,"Node");
    node->labelsize(10);
    //node->box(FL_PLASTIC_UP_BOX);
    node->callback(secim_CB,this);
    node->color2(FL_GREEN);

    lamp=new Fl_Round_Button(x,y+70,w-10,20,"Lamp");
    lamp->labelsize(10);
    lamp->callback(secim_CB,this);
    lamp->color2(FL_GREEN);

    switchs=new Fl_Round_Button(x,y+115,w-10,20,"Switch");
    switchs->labelsize(10);
    switchs->callback(secim_CB,this);
    switchs->color2(FL_GREEN);

    diode=new Fl_Round_Button(x,y+160,w-10,20,"Diode");
    diode->labelsize(10);
    diode->callback(secim_CB,this);
    diode->color2(FL_GREEN);

    battery=new Fl_Round_Button(x,y+205,w-10,20,"Battery");
    battery->labelsize(10);
    battery->callback(secim_CB,this);
    battery->color2(FL_GREEN);

    resistance=new Fl_Round_Button(x,y+250,w-10,20,"Resistance");
    resistance->labelsize(10);
    resistance->callback(secim_CB,this);
    resistance->color2(FL_GREEN);

}

EToolBar::~EToolBar()
{
    //dtor
}
void EToolBar::secim_CB(Fl_Widget *p,void *userdata)
{
    EToolBar *gecici=(EToolBar *)userdata;
    gecici->secim_CB2(p);
}
void EToolBar::secim_CB2(Fl_Widget *p)
{
    Fl_Light_Button *gecici=dynamic_cast<Fl_Light_Button *>(p);
    node->value(0);
    resistance->value(0);
    lamp->value(0);
    battery->value(0);
    switchs->value(0);
    diode->value(0);
    gecici->value(1);
    tip=gecici->label();

}
